#include "Clock.h"


Clock::Clock(int nMsTimeOut)
{
	setInterval(nMsTimeOut);
}


Clock::~Clock()
{
	stop();
	disconnect(this, &QTimer::timeout, this, &Clock::OnTimeout);
}

void Clock::Init()
{
	setSingleShot(false);
	connect(this, &QTimer::timeout, this, &Clock::OnTimeout);

	start();
}

void Clock::OnTimeout()
{
	m_func();
}
